package day2;

/**
 * ClassName：Test3
 *
 * @Author：小鱼
 * @Create：2025-08-19 11:25
 */
public class Test3 {
    public static void main(String[] args) {
        Runnable r = new MyRunable();
       // r.run();//还是主线程
        Thread t = new Thread(r);
        t.start();
        //t.run();


        Runnable r2 = new Runnable() {
            @Override
            public void run() {
                String name = Thread.currentThread().getName();
                System.out.println("线程name: "+name);
            }
        };
        Thread t2 = new Thread(r2,"子线程");
        t2.start();
        System.out.println(t2.getName());
    }
}
